package com.epoint.juc.callable;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Demo {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> futureTask = new FutureTask<>(() -> "大家好，我是callable");

        new Thread(futureTask).start();

        System.out.println("开始~~~~~~");

        String s = futureTask.get();

        System.out.println(s);
    }

}
